package utils.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;

import utils.factory.FindPageFragmentFactory;

/**
 * Created by dllo on 15/11/17.
 */
public class FindPageTitleAdapter extends FragmentStatePagerAdapter {

    private String[] title = {"推荐", "分类","直播","榜单","主播"};

    public FindPageTitleAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return FindPageFragmentFactory.createFragment(position);
    }

    @Override
    public int getCount() {
        return title.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
